package net.lab1024.smartadmin.module.business.front.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.lab1024.smartadmin.module.business.front.domain.dto.FrontQueryDTO;
import net.lab1024.smartadmin.module.business.front.domain.entity.FrontEntity;
import net.lab1024.smartadmin.module.business.front.domain.vo.FrontExcelVO;
import net.lab1024.smartadmin.module.business.front.domain.vo.FrontVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @since JDK1.8
 */
@Mapper
@Component
public interface FrontDao extends BaseMapper<FrontEntity> {

    /**
     * 分页查询
     * @param queryDTO
     * @return FrontVO
     */
    IPage<FrontVO> queryByPage(Page page, @Param("queryDTO") FrontQueryDTO queryDTO);

    /**
     * 根据id删除
     * @param id
     * @return
     */
    void deleteById(@Param("id") Long id);

    /**
     * 根据id批量删除
     * @param idList
     * @return
     */
    void deleteByIdList(@Param("idList") List<Long> idList);

    /**
     * 查询所有导出数据
     * @param queryDTO
     * @return
     */
    List<FrontExcelVO> queryAllExportData(@Param("queryDTO") FrontQueryDTO queryDTO);

    /**
     * 查询批量导出数据
     * @param idList
     * @return
     */
    List<FrontExcelVO> queryBatchExportData(@Param("idList") List<Long> idList);
}
